

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>fix insert/rate/region command &mdash; LIGGGHTS v3.X documentation</title>
  

  
  
  
  

  

  
  
    

  

  
  
    <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  

  

  
    <link rel="top" title="LIGGGHTS v3.X documentation" href="index.html"/> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="Manual.html" class="icon icon-home"> LIGGGHTS
          

          
          </a>

          
            
            
              <div class="version">
                v3.X
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_input_script.html">3. Input Script</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">4. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_gran_models.html">5. Contact models</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_mesh_modules.html">6. Mesh modules</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">7. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">8. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">9. Modifying &amp; extending LIGGGHTS(R)-PUBLIC</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">10. Python interface to LIGGGHTS(R)-PUBLIC</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">11. Errors</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="Manual.html">LIGGGHTS</a>
        
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="Manual.html">Docs</a> &raquo;</li>
        
      <li>fix insert/rate/region command</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="_sources/fix_insert_rate_region.txt" rel="nofollow"> View page source</a>
          
          <a href="http://www.cfdem.com"> Website</a>
          
            <a href="Section_commands.html#comm" rel="nofollow"> Commands</a>
            
          
        
      </li>
    
  </ul>

  
  <hr/>
  
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="fix-insert-rate-region-command">
<span id="index-0"></span><h1>fix insert/rate/region command<a class="headerlink" href="#fix-insert-rate-region-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>fix ID group-ID insert/rate/region seed seed_value distributiontemplate dist-ID general_keywords general_values insert_rate_keywords insert_rate_values
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="fix.html"><em>fix</em></a> command</li>
<li>insert/rate/region = style names of these fix commands</li>
<li>seed = obligatory keyword</li>
<li>seed_value = random # seed (prime number greater 10000)</li>
<li>distributiontemplate = obligatory keyword</li>
<li>dist-ID = ID of a <a class="reference internal" href="fix_particledistribution_discrete.html"><em>fix_particledistribution_discrete</em></a> to be used for particle insertion</li>
<li>one or more general keyword/value pairs can be appended</li>
<li>general_keywords = <em>verbose</em> or <em>maxattampt</em> or <em>nparticles</em> or <em>mass</em> or <em>particlerate</em> or <em>massrate</em> or <em>insert_every</em> or <em>overlapcheck</em> or <em>all_in</em> or <em>random_distribute</em> or <em>compress_tags</em> or <em>vel constant</em> or <em>vel uniform</em> or <em>vel gaussian</em> or <em>orientation</em> or <em>omega</em> or <em>set_property</em></li>
</ul>
<pre class="literal-block">
<em>verbose</em> = yes or no
<em>maxattempt</em> value = ma
  ma = max # of insertion attempts per atom (positive integer)
<em>nparticles</em> values = np or INF
  np =  number of particles to insert (positive integer)
  INF =  insert as many particles as possible
<em>mass</em> values = mp
  mp = mass of particles to be inserted (positive float)
  INF =  insert as many particles as possible
<em>particlerate</em> values = pr
  pr = particle insertion rate (particles/time units)
<em>massrate</em> values = mr
  mr = mass insertion rate (mass/time units)
<em>insert_every</em> value = ie
  ie = every how many time-steps particles are inserted - insertion happens periodically (positive integer)
<em>start</em> value = ts
  ts = time-step at which insertion should start (positive integer larger than current time-step)
<em>overlapcheck</em> value = yes or no
<em>all_in</em> value = yes or no
<em>random_distribute</em> value = exact or uncorrelated
<em>compress_tags</em> value = yes or no
<em>vel constant</em> values = vx vy vz
  vx = x-velocity at insertion (velocity units)
  vy = y-velocity at insertion (velocity units)
  vz = z-velocity at insertion (velocity units)
<em>vel uniform</em> values = vx vy vz vFluctx vFlucty vFluctz
  vx = mean x-velocity at insertion (velocity units)
  vy = mean y-velocity at insertion (velocity units)
  vz = mean z-velocity at insertion (velocity units)
  vFluctx = amplitude of uniform x-velocity fluctuation at insertion (velocity units)
  vFlucty = amplitude of uniform y-velocity fluctuation at insertion (velocity units)
  vFluctz = amplitude of uniform z-velocity fluctuation at insertion (velocity units)
<em>vel gaussian</em> values = vx vy vz vFluctx vFlucty vFluctz
  vx = mean x-velocity at insertion (velocity units)
  vy = mean y-velocity at insertion (velocity units)
  vz = mean z-velocity at insertion (velocity units)
  vFluctx = standard deviation of Gaussian x-velocity fluctuation at insertion (velocity units)
  vFlucty = standard deviation of Gaussian y-velocity fluctuation at insertion (velocity units)
  vFluctz = standard deviation of Gaussian z-velocity fluctuation at insertion (velocity units)
<em>orientation</em> values = random or template or constant q1 q2 q3 q4
  random = randomize rotational orientation
  template = use orientation from particle template
  constant = use constant quaternion for orientation
  q1 q2 q3 q4 = quaternion values for constant orientation
<em>omega</em> values = constant omegax omegay omegaz
  constant = obligatory word
  omegax = x-component of angular velocity (1/time units)
  omegay = y-component of angular velocity (1/time units)
  omegaz = z-component of angular velocity (1/time units)
<em>set_property</em> values = property-varname val
  property-varname = variable name of a <a class="reference internal" href="fix_property.html"><em>fix property/atom</em></a> holding a scalar value for each particle
  val = value to initialize the property with upon insertion
</pre>
<ul class="simple">
<li>following the general keyword/value section, one or more rate_region keyword/value pairs can be appended for the fix insert/rate/region command</li>
<li>rate_region keywords = <em>region</em> or <em>check_dist_from_subdomain_border</em> or <em>ntry_mc</em></li>
</ul>
<pre class="literal-block">
<em>region</em> value = region-ID
  region-ID = ID of the region where the particles will be generated (positive integer)
<em>check_dist_from_subdomain_border</em> values = yes or no
<em>ntry_mc</em> values = n
  n = number of Monte-Carlo steps for calculating the region's volume  (positive integer)
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>fix ins all insert/rate/region seed 123457 distributiontemplate pdd1 nparticles 1000 particlerate 5000 insert_every 1000 overlapcheck yes region mysphere ntry_mc 10000
</pre></div>
</div>
<p><strong>General description:</strong></p>
<p>Insert particles into a granular run every few timesteps
within a specified region at a specified rate.</p>
<p>The <em>verbose</em> keyword controls whether statistics about particle
insertion is output to the screen each time particles are inserted.</p>
<p>This command must use the <em>region</em> keyword to define an insertion
volume. The specified region must have been previously defined with a
<a class="reference internal" href="region.html"><em>region</em></a> command. Dynamic regions are not supported as
insertion region. Each timestep particles are inserted, they are
placed randomly inside the insertion volume.</p>
<p>To specify the number of particles to be inserted, you must use either
the <em>nparticles</em> or the <em>mass</em> keyword (but not both). In the latter
case, the number of particles to be inserted is calculated from the
mass expectancy given by the particle distribution.</p>
<p>Likewise, you can use the <em>particlerate</em> or the <em>massrate</em> keyword (but not both)
to control the insertion rate.</p>
<p>The frequency of the particle insertion is controlled by the
keyword <em>insert_every</em>, which defines the number of time-steps
between two insertions. The number of particles to be inserted
at each insertion event is calculated from the insertion rate
and <em>insert_every</em>. The <em>start</em> keyword can be used to set
the time-step at which the insertion should start.</p>
<p>This command must use the distributiontemplate keyword to refer to a
<a class="reference internal" href="fix_particledistribution_discrete.html"><em>fix_particledistribution_discrete</em></a> (defined by dist-fix-ID) that defines the properties of the
inserted particles.</p>
<p>Inserted particles are assigned the atom type specified by the
particledistribution defined via the <a class="reference internal" href="fix_particledistribution_discrete.html"><em>fix_particledistribution_discrete</em></a> and
are assigned to 4 groups: the default group &#8220;all&#8221; and the group
specified in the fix insert command, as well as the groups specified
in the <a class="reference internal" href="fix_particledistribution_discrete.html"><em>fix_particledistribution_discrete</em></a> and <a class="reference internal" href="fix_particletemplate_sphere.html"><em>fix_particletemplate_sphere</em></a>
command (all of which can also be &#8220;all&#8221;).</p>
<p>The keyword <em>overlapcheck</em> controls if overlap is checked for at insertion,
both within the inserted particle package and with other existing particles.
If this option is turned off, insertion will scale very well in parallel,
otherwise not. Be aware that in case of no overlap check, highly overlapping
configurations will be produced, so you will have to relax these configurations.</p>
<p>With keyword <em>check_dist_from_subdomain_border</em>, the user can specify if
in case of <em>overlapcheck</em> = yes particles are inserted only at least one
bounding radius away from processor domain borders to avoid possible
overlaps with particles inserted on another process.</p>
<p>If overlapcheck if performed, the number of insertion attempts per
particle can be specified via the <em>maxattempt</em> keyword. Each timestep
particles are inserted, the command will make up to a total of M tries
to insert the new particles without overlaps, where
M = # of inserted particles * ma.  If unsuccessful at completing all
insertions, a warning will be printed.</p>
<p>The <em>all_in</em> flag determines if the particle is completely contained
in the insertion region (<em>all_in yes</em>) or only the particle center
(<em>all_in no</em>). Currently <em>all_in yes</em> is not yet supported for all
types of insertion.</p>
<p>Keyword <em>random_distribute</em> controls how the number of particles to
be inserted is distributed among parallel processors and among the
particle templates in the particle distribution. For style <em>exact</em>,
the number of particles to be inserted each step is matched exactly.
For style <em>uncorrelated</em>, the number of particles to be inserted
for each particle template will be rounded in an uncorrelated way,
so the total number of inserted particles may vary for each insertion
step. However, statistically both ways should produce the same
result. Style <em>uncorrelated</em> may be faster in parallel since it
does not need global MPI operations.
Please note that if the # of particles to be inserted is calculated
e.g. from a particle mass to be inserted, the number of particles
to be inserted each insertion step will vary by 1, irrespective of
the <em>random_distribute</em> settings. This is because in this case the
# of particles to insert in each step will be a floating point number,
and applying a simple floor/ceil rounding operation would lead to a
statistical bias.</p>
<p>If keyword <em>compress_tags</em> is set to &#8216;yes&#8217;, then atom IDs are re-assigned
after each insertion procedure. The default is &#8216;no&#8217;. This is typically
only recommended if some models internally store arrays which have the
length defined via the max ID of any atom.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Setting <em>compress_tags</em> to &#8216;yes&#8217; will result in all contact
history to be lost at that point in time. External post-processing tools
will give wrong results because they typically track atoms via their IDs.</p>
</div>
<p>The initial velocity and rotational velocity can be controlled via the
<em>vel</em> and <em>omega</em> keywords. <em>vel constant</em> simply patches a constant
velocity to the inserted particles, <em>vel uniform</em> sets uniformly distributed
velocities with mean and amplitude. <em>vel gaussian</em> sets Gaussian
distributed particle velocities with mean and std. deviation.</p>
<p>The <em>set_property</em> option can be used to initialize scalar per-particle
properties such as temperatures, which are stored in a
a <a class="reference internal" href="fix_property.html"><em>fix property/atom</em></a>.</p>
</div>
<div class="section" id="restart-fix-modify-output-run-start-stop-minimize-info">
<h2>Restart, fix_modify, output, run start/stop, minimize info<a class="headerlink" href="#restart-fix-modify-output-run-start-stop-minimize-info" title="Permalink to this headline">¶</a></h2>
<p>Information about this fix is written to <a class="reference internal" href="restart.html"><em>binary restart files</em></a>.  This means you can restart a simulation
while inserting particles, when the restart file was written during the
insertion operation.</p>
<p>None of the <a class="reference internal" href="fix_modify.html"><em>fix_modify</em></a> options are relevant to this
fix.  A global vector is stored by this fix for access by various <span class="xref std std-ref">output commands</span>. The first component of the vector is the
number of particles already inserted, the second component is the mass
of particles already inserted. No parameter of this fix can be
used with the <em>start/stop</em> keywords of the <a class="reference internal" href="run.html"><em>run</em></a> command.
This fix is not invoked during <code class="xref doc docutils literal"><span class="pre">energy</span> <span class="pre">minimization</span></code>.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>The <em>overlapcheck</em> = &#8216;yes&#8217; option performs an inherently serial operation
and will thus not scale well in parallel. For this reason, if you
want to generate large systems, you are advised to turn <em>overlapcheck</em>
off and let the packing relax afterwards to generate a valid packing.</p>
<p>Option <em>all_in</em> = &#8216;yes&#8217; will not work if the <a class="reference internal" href="region.html"><em>region</em></a> used
is a tet mesh region.</p>
<p>Keywords <em>duration</em> and <em>extrude_length</em> can not be used together.</p>
<p>Currently <em>all_in yes</em> is not yet supported for all types of insertion.</p>
<p>Dynamic regions are not supported as insertion region.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="fix_insert_stream.html"><em>fix_insert_stream</em></a>, <a class="reference internal" href="fix_insert_pack.html"><em>fix_insert_pack</em></a>,
<a class="reference internal" href="fix_gravity.html"><em>fix_gravity</em></a>, <a class="reference internal" href="region.html"><em>region</em></a></p>
</div>
<div class="section" id="default">
<h2>Default<a class="headerlink" href="#default" title="Permalink to this headline">¶</a></h2>
<p>The defaults are maxattempt = 50, all_in = no, overlapcheck = yes
vel = 0.0 0.0 0.0, omega = 0.0 0.0 0.0, start = next time-step,
duration = insert_every, ntry_mc = 100000, random_distribute = exact,
<em>compress_tags</em> = no, <em>check_dist_from_subdomain_border</em> = yes</p>
</div>
</div>


           </div>
           <div class="articleComments">
            
           </div>
          </div>
          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2016, DCS Computing GmbH, JKU Linz and Sandia Corporation.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'v3.X',
            LANGUAGE:'None',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true,
            SOURCELINK_SUFFIX: ''
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>

  

  
  
    <script type="text/javascript" src="_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
   

</body>
</html>